﻿using System;
using WEATHER.Components;
using System.Web;

namespace WEATHER.Modules.ONLINE.Pages
{
    public partial class HydrologicForecastWeather : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (IsPostBack == false)
            {
                if (Request.QueryString != null)
                {
                    HydrologicForecastWeatherType weatherType = (HydrologicForecastWeatherType) Enum.Parse(typeof (HydrologicForecastWeatherType), Request.QueryString["HydrologicForecastWeatherType"]);
                    Guid mid = new Guid(Request.QueryString["mid"]);
                    // Hà Nội.
                    ContentPane.InnerHtml = HttpUtility.HtmlDecode(Components.HydrologicForecast.GetWeatherOnline(mid, weatherType, "74165"));
                    divTramThuyVan.Visible = Request.QueryString["HydrologicForecastWeatherType"].Contains("SongBacBo");
                }
            }
        }

        protected void ddlTramThuyVan_SelectedIndexChanged(object sender, EventArgs e)
        {
            HydrologicForecastWeatherType weatherType = (HydrologicForecastWeatherType)Enum.Parse(typeof(HydrologicForecastWeatherType), Request.QueryString["HydrologicForecastWeatherType"]);
            Guid mid = new Guid(Request.QueryString["mid"]);
            ContentPane.InnerHtml = HttpUtility.HtmlDecode(Components.HydrologicForecast.GetWeatherOnline(mid, weatherType, ddlTramThuyVan.SelectedValue));
        }
    }
}
